<template>
  <view class="announcement-bar">
    <view class="announcement-content">
      <text class="announcement-text">{{ props.tip }}</text>
    </view>
  </view>
</template>
<script setup lang="ts">
const props = defineProps({
  tip: {
    type: String,
    default: '11111',
  },
})
</script>
<style lang="scss">
.announcement-bar {
  padding: 10rpx 0;
  position: relative;
  z-index: 10;
  overflow: hidden;
  background: rgba(46, 131, 255, 0.15);
  border: 2rpx solid #00ffff;
  border-radius: 20rpx;
  box-shadow: 0 0 15rpx rgba(46, 131, 255, 0.3);
}

.announcement-content {
  white-space: nowrap;
  animation: scroll 20s linear infinite;
}

.announcement-text {
  font-size: 20rpx;
  color: #00ffff;
  text-shadow:
    0 0 10rpx rgba(0, 255, 255, 0.8),
    0 0 20rpx rgba(0, 255, 255, 0.6),
    0 0 30rpx rgba(0, 255, 255, 0.4);
  animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes scroll {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes textGlow {
  from {
    text-shadow:
      0 0 10rpx rgba(255, 215, 0, 0.8),
      0 0 20rpx rgba(255, 215, 0, 0.6),
      0 0 30rpx rgba(255, 215, 0, 0.4);
  }
  to {
    text-shadow:
      0 0 15rpx rgba(255, 215, 0, 1),
      0 0 30rpx rgba(255, 215, 0, 0.8),
      0 0 45rpx rgba(255, 215, 0, 0.6);
  }
}
</style>
